package com.jilefojing.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;

import com.jilefojing.beans.enums.ItemTypeEnumForSource;
import com.jilefojing.beans.pojos.RSourceUser;
import com.jilefojing.dao.IRSourceUserDao;
import com.jilefojing.dao.base.impl.BaseDao;
import com.jilefojing.dao.mapper.IRSourceUserMapper;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月21日 00时01分08秒
 */
@Repository
public class RSourceUserDao extends BaseDao<RSourceUser> implements IRSourceUserDao {
	@Autowired
	private IRSourceUserMapper rSourceUserMapper;

	@Override
	public List<RSourceUser> getByItems(ItemTypeEnumForSource itemType, List<Long> itemIds) {
		Example example = new Example(RSourceUser.class);
		Criteria criteria = example.createCriteria();
		criteria.andEqualTo(RSourceUser.FIELD_ITEMTYPE, itemType.getCode());
		criteria.andIn(RSourceUser.FIELD_ITEMID, itemIds);
		return super.getListByExample(example);
	}
}
